package com.example.demo.service.impl;

import java.util.*;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.bean.Order;
import com.example.demo.dao.OrderMapper;
import com.example.demo.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {


    @Autowired
    OrderMapper orderMapper;

    public List<Order> getAllWithPagination(int current, int size) {
        Page<Order> page = new Page<>(current, size);
        IPage<Order> orderList = orderMapper.selectPage(page, null);
        return orderList.getRecords();
    }
}
